﻿using blackhouse.NemoBlog.Business.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace blackhouse.NemoBlog.Web {
    public abstract class WebBlogViewFactory : IBlogViewFactory {

        #region Methods

        public abstract IPostListView LoadPostListView();

        public abstract IPostListView LoadLastPostListView();

        public abstract IPostView LoadPostView();

        protected Control LoadUserControl(string pathToControl) {
            Control ctrl = null;
            if (HttpContext.Current != null) {
                Page p = HttpContext.Current.Handler as Page;
                if (p != null)
                    ctrl = p.LoadControl(pathToControl);
            }
            return ctrl;
        }

        #endregion

    }
}